package org.broadway.monitor;

import org.broadway.interfaces.Action;
import org.broadway.interfaces.Context;
import org.broadway.interfaces.Evaluator;
import org.broadway.interfaces.ResourceCollector;
import org.broadway.interfaces.Scanner;

/**
 * The Monitor interface represents a component that can,
 * not only scan, but monitor an arbitrary condition.
 * The resources to be monitored are accessible through
 * a ResourceCollector object.  The monitor uses an Evaluator component
 * to determine how and what to monitor.  
 * When the a pre-determined condition is encontered, the Monitor can delegate an action to the 
 * Action component to execute additional logic.  The monitor uses
 * a Context object to share data between the different components.
 * 
 * @see Context
 * @see ResourceCollector
 * @see Evaluator
 * @see Action
 * 
 * @author vladimir vivien
 *
 */
public interface Monitor extends Scanner{
	/**
	 * Setter to set the Context object used to share data
	 * between monitor components.
	 * @param ctx - Context object
	 */
	public void setContext(Context ctx);
	
	/**
	 * Setter to set a ResourceCollector object used by the monitor
	 * to return a collection of monitored resources.
	 * @param resCollector - ResourceCollector
	 */
	public void setResourceCollector(ResourceCollector resCollector);
	
	/**
	 * Setter for the Evaluator component used by the monitor to evaluate
	 * logic / arbitrary conditions during monitoring.
	 * @param evaluator - Evaluator
	 */
	public void setEvaluator(Evaluator evaluator);
	
	/**
	 * This is the setter for the Action component used by the monitor.
	 * Based on selected condition, logic, or value evaluated by the Evaluator,
	 * the monitor can delegate appropriate action to be taken to the Action component.
	 * @param action Action
	 */
	public void setAction(Action action);
}